﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Pb;
public class BankerDown : MonoBehaviour {

    public GameObject continueBtn;
    public GameObject bankerDownBtn;


	void Start () {
        UIEventListener.Get(continueBtn).onClick = ButtonClick;
        UIEventListener.Get(bankerDownBtn).onClick = ButtonClick;
	}

    void ButtonClick(GameObject button)
    {
        if (button.name == "GoOnBankerBtn")
        {
            PaiGrabMasterRequest msg = new PaiGrabMasterRequest { };
            SocketManager socketManager = SocketManager.Instance;
            socketManager.SendProtobuf1(msg, MsgId.PaiGrabMasterRequest);
        }
        else if (button.name == "BankerDownBtn")
        {
            PaiGiveUpMasterRequest msg = new PaiGiveUpMasterRequest { Type = 1 };
            SocketManager socketManager = SocketManager.Instance;
            socketManager.SendProtobuf1(msg, MsgId.PaiGiveUpMasterRequest);
            EginXTJ.Instance.isBanker = false;
        }
        Destroy(gameObject);
    }   
    
}
